  <table width="100%" border="1" style="border-radius: 7px 7px 7px 7px;">  <tr> 
    	<td align="center"><strong><font color="#000000">STT</font></strong></td>
          <td align="center"><strong><font color="#000000">ID</font></strong></td>
          <td align="center" nowrap="nowrap"><strong><font color="#000000">Thể Loại</font></strong></td>

 		<td align="center"><strong><font color="#000000">Edit | Delete</font></strong></td>
        </tr>
<?PHP
include("../../DataProvider.php");
if(isset($_GET["page"]))
{
	$page = $_GET["page"];
	$sql1 = "SELECT * FROM tbl_categories";
	$result1 = DataProvider::ExecuteQuery($sql1);
	$tongsorecord = mysql_num_rows($result1);
	$y = 9;
	$start = ($page-1)*$y;
	$tongsotrang = ceil($tongsorecord/$y);
	
	$sql = "SELECT * FROM tbl_categories Order by STT limit $start,$y ";
	$result = DataProvider::ExecuteQuery($sql);
	
while($row = mysql_fetch_array($result))
{
?>
        <tr> 
        <td align="center"><?php echo $row['STT']; ?></td>
          <td align="center"><?php echo $row['idCategories']; ?></td>
          <td align="center" id="<?php echo $row['idCategories']; ?>"><?php echo $row['categories']; ?></td>
                   
  <td nowrap="nowrap" align="center"><a href="#" onclick="editCate('<?php echo $row['idCategories']; ?>','<?php echo $row['categories']; ?>','<?php echo $row['STT']; ?>')"><strong>Edit</strong></a> | <a onclick="deleteCate(<?php echo $row['idCategories']; ?>)" href="#"><strong>Delete</strong></a></td>
        </tr><?php }?>
        <tr align="right"><td colspan="4"> <div id="pt" align="center"><span style=" margin-right:1px;color:#000; background-color:#fff;border:solid;  border-color:#000; border-width:2px;">&nbsp;Trang <?php echo $page."/".$tongsotrang; ?>&nbsp;</span>
        <?php
        if($page == 1)
				{echo"<span class='active' style='color:#000; background-color:#fff;border:solid; border-color:#000; border-width:2px;'><<</span>";}
				else
				{
				echo"<span class='paging'><a style='text-decoration:none;' href='#1' onclick='javascript:loadCategoriesAdmin(1);'><< </a> </span>";}
			for($i=1;$i<=$tongsotrang;$i++){
				
				if($i == $page){
				 echo "<span class='active' style=' margin-right:1px; ; background-color:#fff;border:solid; border-color:#000; border-width:2px;'>$i</span>";	
				}else{
					echo "<span class='paging'><a style='text-decoration:none;' href='#$i' onclick='javascript:loadCategoriesAdmin($i);'> $i</a>  </span>";	
				}
			}
			if($page == $tongsotrang)
				{echo"<span class='active' style='  background-color:#fff;border:solid; border-color:#000; border-width:2px;'>>></span>";}
				else
				{
				echo"<span class='paging' ><a style='text-decoration:none;' href='#$i' onclick='javascript:loadCategoriesAdmin($tongsotrang);'> >> </a></span>";
				}
?>
</div></td></tr>
<?php
}

?></table>